<!--
 * @Author zhaoyuemi
 * @Date 2020/10/13
 * @LastEditTime 2020/10/19
 * @LastEditors 86157
 * @Description aliPay  中转页面
 * @FilePath
 * @ router
 * @version 1.0
-->

<template>
    <div class="ali-pay">
        <loading v-if="loading"></loading>
        <div class="from" v-html="content"></div>
    </div>
</template>

<script>
    import Loading from './../components/Loading'
    export default {
        name: "aliPay",
        data(){
            return{
                orderId:this.$route.query.orderId,
                content:'',
                loading:true,
            }
        },
        components:{
            Loading
        },
        mounted() {
            this.paySubmit();
        },
        methods:{
            paySubmit(){
                this.axios.post('/api/pay',{
                    orderId:this.orderId,
                    orderName:'Vue高仿',
                    amount:0.01,//单位元
                    payType:1 //1支付宝，2微信
                }).then((res)=>{
                    this.content = res.content;
                    setTimeout(function () {
                        document.forms[0].submit();
                    },1000)
                })
            }
        }
    }
</script>

<style scoped>

</style>